package com.liyk.shop.component.rabbitmq;

import com.liyk.shop.domain.entity.ProductKillOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class OrderSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    /**秒杀成功邮件通知*/
    public void sendOrderEmail(ProductKillOrder order) {
        log.info(order.getUserEmail());
        this.rabbitTemplate.convertAndSend(RabbitQueue.ORDER_EMAIL, order);
    }
}
